
var vm =  new Vue({
    el : "#app",
    data : {
        cont_show_:true,
        id:'',
        start:'',//入住时间
        end:'',//离店时间
        day_time:'',//入住天数
        userPhone:'15858585558',
        token:'',//id
        hotelId:'',
        info:'',//酒店详细信息
        yesterday:'',//昨天日期
        address:'',//位置
        imgServerUrl:'',//图片地址前缀
        hotelName:'',//酒店名字
        city_aggre:{},//房间集合
        unitPrice:'',//单价。。接口获取的or上个页面传来的
    },
    created:function(){
        this.token = _lSGet('token');//获取公用token
        this.hotelId = _lSGet('hotelId');
        this.address = _lSGet('address');//获取上个页面传入的位置
        this.hotelName = _lSGet('hotelName');//获取上个页面传入的酒店名
        this.userPhone = _lSGet('reservePhone');//获取上个页面传入的电话
        this.info = _lSGet('info');//获取上个页面传入的酒店信息
        if( _lSGet('urls')){
            var urls =JSON.parse( _lSGet('urls'));
            this.imgServerUrl=urls.imgServerUrl+'/';
        }else{
            this.imgServerUrl=imgViewUrl;//congif里的图片路径
        };
        this.getData();//请求列表

    },
    mounted:function(){
        setTimeout(function(){
            var mySwiper = new Swiper(".swiper-container",{
                direction:"horizontal",/*横向滑动*/
                loop:true,/*形成环路（即：可以从最后一张图跳转到第一张图*/
                pagination:".swiper-pagination",/*分页器*/
                prevButton:".swiper-button-prev",/*前进按钮*/
                nextButton:".swiper-button-next",/*后退按钮*/
                observer:true,//修改swiper自己或子元素时，自动初始化swiper
                observeParents:true,//修改swiper的父元素时，自动初始化swiper
                paginationClickable :true,
                autoplay:3000/*每隔3秒自动播放*/
            })
        },50)

    },
    methods:{

        getData:function(){
            var that=this;
            var params = {};
            params.hotelId = this.hotelId;
            params.page=1;
            params.pageSize=10;
            //params.checkinTime=this.start;//入住时间
            params.checkinTime=null;//入住时间
            //params.checkoutTime=this.end;//离店时间
            params.checkoutTime=null;//离店时间
            params.checkinType=1;//短租固定2
            params.pageSize=10;
            params.token=this.token;
            sendRequest('/roomTypeStatus/getReserveNum', params, function(res) {
                //that.go_login_home(res);
                //res = res.data;
                //goLogin(res);//公用回家
                console.log('okla')
                console.log(res)
                if(res.status == '1') {
                    that.city_aggre=res.rows;
                    console.log(that.city_aggre);
                }

            });
        },
        go_details:function(item){
            _lSSaveOrUpdate( 'itemLong', JSON.stringify(item) );

            window.location.href=indexUrl+'/app/room-details.html?_t=' + Math.random() ;
        },
       call_phone:function(){
            window.location.href='tel:'+this.userPhone+'';
        },
        //errImg:function(e){//图片错误处理
        //    //var img= e.target;
        //    $( e.target).attr("src","./assets/img/imgeee.png");
        //},

    },
    computed: {

    },
    watch:{

    },

    components:{


    }


});